package cn.easybuy.util;

import cn.easybuy.entity.Product;

/**
 * 购物车明细 
 *   商品的基础信息
 *   购买数量
 *   小计
 * 
 * 
 * 借助订单明细表理解这个类的作用
 * @author Tom
 *
 */
public class ShoppingCartItem {

	private Product product =new Product();
	
	private int count ;//购买的数量
	
	private double price; //小计

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
		if (this.count>0) {
			double sum_price = this.count * product.getPrice();
			this.setPrice(sum_price);
		}
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}
	
	
	
}
